<template>
  <div>
    <el-row style="margin-left:-13px;">
      <el-tooltip effect="light" content="清关发票" placement="top">
        <img v-if="qing1" :src="qing1" />
      </el-tooltip>
      <el-tooltip effect="light" content="代理发票" placement="top">
        <img v-if="dai1" :src="dai1" />
      </el-tooltip>
      <el-tooltip
        effect="light"
        content="已放预报"
        placement="top"
        v-if="fang1 === fang2"
      >
        <img v-if="fang1" :src="fang1" />
      </el-tooltip>
      <img v-else :src="fang1" />

      <el-tooltip effect="light" content="待AMS申报" placement="top">
        <img v-if="ams === 0" :src="ams_init" />
      </el-tooltip>
      <el-tooltip effect="light" content="AMS上传EDI文件失败" placement="top">
        <img v-if="ams === -1" :src="ams_edi_fail" />
      </el-tooltip>
      <el-tooltip effect="light" content="AMS申报失败" placement="top">
        <img v-if="ams === -2" :src="ams_fail" />
      </el-tooltip>
      <el-tooltip effect="light" content="AMS上传EDI文件成功" placement="top">
        <img v-if="ams === 1" :src="ams_edi_success" />
      </el-tooltip>
      <el-tooltip effect="light" content="AMS申报成功" placement="top">
        <img v-if="ams === 3" :src="ams_success" />
      </el-tooltip>

      <el-tooltip effect="light" content="待ISF申报" placement="top">
        <img v-if="isf === 0" :src="isf_init" />
      </el-tooltip>
      <el-tooltip effect="light" content="ISF上传EDI文件失败" placement="top">
        <img v-if="isf === -1" :src="isf_edi_fail" />
      </el-tooltip>
      <el-tooltip effect="light" content="ISF申报失败" placement="top">
        <img v-if="isf === -2" :src="isf_fail" />
      </el-tooltip>
      <el-tooltip effect="light" content="ISF上传EDI文件成功" placement="top">
        <img v-if="isf === 1" :src="isf_edi_success" />
      </el-tooltip>
      <el-tooltip effect="light" content="ISF申报成功" placement="top">
        <img v-if="isf === 3" :src="isf_success" />
      </el-tooltip>

      <el-tooltip effect="light" placement="left">
        <div
          slot="content"
          v-html="data['sysRemark']"
          style="max-width:500px;overflow:auto;background: #e1e5e8;font-size: 15px;line-height: 16px;color: #888;max-height: 320px;"
        ></div>
        <i style="font-size:20px" class="el-icon-s-flag"></i>
      </el-tooltip>

      <el-tooltip effect="light" :content="podData" placement="top">
        <img v-if="podGreen" :src="podGreen"/>
      </el-tooltip>
    </el-row>
  </div>
</template>

<script>
import { ajax } from "@/store/yg/common/utils";
import axios from "axios";
import * as constant from "@/store/yg/common/constant";
import { m } from "@/store/yg/common/local";
import podHand from "@/assets/images/pod_hand.png";
import podNot from "@/assets/images/pod_not.png";
import podComplete from "@/assets/images/pod_complete.png";
import deliveryPng from "@/assets/images/delivery.png";
import undeliveryPng from "@/assets/images/undelivery.png";
import tdGreenPng from "@/assets/images/tdGreen.png";
import yesbillstatusPng from "@/assets/images/yesbillstatus.png";
import nobillstatusPng from "@/assets/images/nobillstatus.png";
import portdestination0Png from "@/assets/images/portdestination0.png";
import portdestination1Png from "@/assets/images/portdestination1.png";
import payforcustomsdeclarationPng from "@/assets/images/payforcustomsdeclaration.png";
import payforcustomsdeclarationbluePng from "@/assets/images/payforcustomsdeclarationblue.png";
import payforcustomsdeclarationgreenPng from "@/assets/images/payforcustomsdeclarationgreen.png";
import generalgreendeclarationPng from "@/assets/images/generalgreendeclaration.png";
import generalbusinessdeclarationPng from "@/assets/images/generalbusinessdeclaration.png";
import waybillyesvatPng from "@/assets/images/waybillyesvat.png";
import waybillnovatPng from "@/assets/images/waybillnovat.png";
import waybillredvatPng from "@/assets/images/waybillredvat.png";
import fang1Png from "@/assets/images/fang1.png";
import fang2Png from "@/assets/images/fang2.png";
import mergerdeclarationPng from "@/assets/images/mergerdeclaration.jpeg";
import nosignExaminePng from "@/assets/images/nosignExamine.png";
import yessignExaminePng from "@/assets/images/yessignExamine.png";
import onlineinqury1Png from "@/assets/images/onlineinqury1.png";
import onlineinqury0Png from "@/assets/images/onlineinqury0.png";
import ispva1Png from "@/assets/images/ispva1.png";
import ispva0Png from "@/assets/images/ispva0.png";
import qing1Png from "@/assets/images/qing1.png";
import qing2Png from "@/assets/images/qing2.png";
import dai1Png from "@/assets/images/dai1.png";
import dai2Png from "@/assets/images/dai2.png";

import ams_init from "@/assets/images/ams0.jpg";
import ams_edi_fail from "@/assets/images/ams-1.jpg";
import ams_fail from "@/assets/images/ams2.jpg";
import ams_edi_success from "@/assets/images/ams1.jpg";
import ams_success from "@/assets/images/ams2.jpg";

import isf_init from "@/assets/images/isf0.png";
import isf_edi_fail from "@/assets/images/isf-1.png";
import isf_fail from "@/assets/images/isf2.png";
import isf_edi_success from "@/assets/images/isf1.png";
import isf_success from "@/assets/images/isf2.png";

export default {
  props: ["row", "data", "more"],
  data() {
    return {
      podGreen: podNot,
      ams_init: ams_init,
      ams_edi_fail: ams_edi_fail,
      ams_fail: ams_fail,
      ams_edi_success: ams_edi_success,
      ams_success: ams_success,

      isf_init: isf_init,
      isf_edi_fail: isf_edi_fail,
      isf_fail: isf_fail,
      isf_edi_success: isf_edi_success,
      isf_success: isf_success,
      sysReamrkData: [],
      // 代
      dai2: dai2Png,
      // 代
      dai1: dai1Png,
      // 清
      qing2: qing2Png,
      // 清
      qing1: qing1Png,
      //  提
      delivery: deliveryPng,
      //  送
      undelivery: undeliveryPng,
      // TD
      tdGreen: tdGreenPng,
      //  起 - yes
      yesbillstatus: yesbillstatusPng,
      //  起 - no
      nobillstatus: nobillstatusPng,
      //  目
      portdestination0: portdestination0Png,
      //  目
      portdestination1: portdestination1Png,
      // 报
      payforcustomsdeclaration: payforcustomsdeclarationPng,
      // 报
      payforcustomsdeclarationblue: payforcustomsdeclarationbluePng,
      // 报
      payforcustomsdeclarationgreen: payforcustomsdeclarationgreenPng,
      // 报
      generalgreendeclaration: generalgreendeclarationPng,
      // 报
      generalbusinessdeclaration: generalbusinessdeclarationPng,
      // VAT
      waybillyesvat: waybillyesvatPng,
      // VAT
      waybillnovat: waybillnovatPng,
      // VAT
      waybillredvat: waybillredvatPng,
      // 放
      fang1: fang1Png,
      // 放
      fang2: fang2Png,
      // 合
      mergerdeclaration: mergerdeclarationPng,
      // 查
      nosignExamine: nosignExaminePng,
      // 查
      yessignExamine: yessignExaminePng,
      // 询
      onlineinqury1: onlineinqury1Png,
      // 询
      onlineinqury0: onlineinqury0Png,
      // PVA
      ispva1: ispva1Png,

      // PVA
      ispva0: ispva0Png,
      systemReamrk: "",
      ams: null,
      podData:""
    };
  },

  methods: {
    initSysRemark() {
      this.sysReamrkData = [];
      var systemReamrks = this.data["sysRemark"];
      if (systemReamrks) {
        var remarks = systemReamrks.split("<br/>");
        remarks.forEach(element => {
          var sysRemark = {};
          sysRemark["remark"] = element;
          this.sysReamrkData.push(sysRemark);
        });
      }
    },
    initShow(isPod,liquidationInvoices, isProxyInvoice, isConfirmPrediction) {
      if (null != isPod && isPod == 1) {
        this.podGreen = podComplete;
        this.podData="上传完成"
      } else if (null!=isPod && isPod==2) {
        this.podGreen = podHand;
        this.podData="上传中"
      }else{
        this.podGreen = podNot;
        this.podData="未上传"
      }

      if (
        liquidationInvoices &&
        null != liquidationInvoices &&
        liquidationInvoices.length > 0
      ) {
        this.qing1 = qing2Png;
      } else {
        this.qing1 = qing1Png;
      }
      if (null != isProxyInvoice && isProxyInvoice == 1) {
        this.dai1 = dai2Png;
      } else {
        this.dai1 = dai1Png;
      }
      if (null != isConfirmPrediction && isConfirmPrediction == 1) {
        this.fang1 = fang2Png;
      } else {
        this.fang1 = fang1Png;
      }
    }
  },
  mounted() {
    this.systemReamrk = this.data["sysRemark"];
    var liquidationInvoices = this.data["liquidationInvoices"];
    var isProxyInvoice = this.data["isProxyInvoice"];
    var isConfirmPrediction = this.data["isConfirmPrediction"];
    this.initShow(liquidationInvoices, isProxyInvoice, isConfirmPrediction);
    this.ams = this.data["ams"];
    const isPod = this.data["checkIsPod"];
    if (null != isPod && isPod == 1) {
      this.podGreen = podComplete;
      this.podData="上传完成"
    } else if (null!=isPod && isPod==2) {
      this.podGreen = podHand;
      this.podData="上传中"
    }else{
      this.podGreen = podNot;
      this.podData="未上传"
    }
  }
};
</script>

<style></style>
